package net.yters.model.agents.concrete;

import java.util.ArrayList;
import java.util.TreeMap;

import net.yters.model.ModelState;
import net.yters.model.Environment.AGNT;
import net.yters.model.agents.Agent;
import net.yters.model.agents.TextAgent;
import net.yters.model.agents.actuators.DamageActuator;
import net.yters.model.agents.actuators.MoveActuator;
import net.yters.util.Box;
import net.yters.util.Util;



public class BulletAgent extends TextAgent {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1991326002920722376L;

	public BulletAgent(ModelState model, ArrayList<Double> position, ArrayList<Object> direction) { // TODO HACK b/c TextAgent wanted this parameter definition
		super(model);
		Util.emboxArray(f_position, position);
		Util.emboxArray(f_direction, direction);
		
		f_type.f_value = new Double(AGNT.BLLT.ordinal());
		f_hp.f_value = new Double(5); // TODO make this more board dependent

		addActuatorAgent(new DamageActuator());
	}

	@Override
	protected
	boolean decide(TreeMap<String, Box> input, Agent actuator) {
		if(actuator instanceof MoveActuator) {
			f_hp.f_value = (Double) f_hp.f_value - 1.0;  
			return true;
		}

		if(actuator instanceof DamageActuator) {
			return true;
		}
		
		return false;
	}

	@Override
	protected void initDecision() {
	}
}
